﻿using log4net;
using log4net.Config;

namespace Bridge.Objects
{
    /// <summary>
    /// Class for log locations.
    /// </summary>
    public class Log
    {
        /// <summary>
        /// Gets the MetricsLog for the UI.
        /// </summary>
        public static ILog MetricsLog
        {
            get
            {
                if (!sIsInitialized)
                {
                    XmlConfigurator.Configure();
                    sIsInitialized = true;
                }
                if (sMetricsLog == null)
                {
                    sMetricsLog = LogManager.GetLogger("Bridge.Base.Utilities.Metrics");
                }
                return sMetricsLog;
            }
        }

        /// <summary>
        /// Gets the Log for the UI.
        /// </summary>
        public static ILog NormalLog
        {
            get
            {
                if (!sIsInitialized)
                {
                    XmlConfigurator.Configure();
                    sIsInitialized = true;
                }
                if (sLog == null)
                {
                    sLog = LogManager.GetLogger("Bridge.UI.Main");
                }
                return sLog;
            }
        }

        private static bool sIsInitialized = false;
        private static ILog sMetricsLog;
        private static ILog sLog;
    }
}
